﻿using Microsoft.SharePoint.Client;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Albatross.SharePoint.Explorer.ViewModels {
	public class RoleAssignmentViewModel : ClientObjectViewModel{
		public RoleAssignmentViewModel(ClientContext context, string name, RoleAssignment roleAssignment) :base(context, name, roleAssignment){
		}
		public RoleAssignment RoleAssignment { get { return (RoleAssignment)ClientObject; } }
		public override string GetTreeItemTitle() {
			if (Name == string.Empty) {
				return "PrincipalId: " + RoleAssignment.PrincipalId;
			} else {
				return Name;
			}
		}
		public override string GetContentTitle() {
			return "Role Assignment";
		}
	}
}
